<div class="modal fade bs-modal-md" id="modelContent">
	<div class="modal-dialog modal-md">
        <div class="modal-content"></div>
    </div>
</div> 
<div class="portlet box green">
	<div class="portlet-title">
	    <div class="caption"><i class="fa fa-cog"></i>查询内容 </div>
		<div class="tools">
			<a href="javascript:;" class="collapse right" data-original-title="" title=""> </a>
    	</div>
    	<div class="actions">
			<a href="javascript:;" class="btn white btn-sm ajax-search"><i class="fa fa-search"></i> 查询 </a>
			<a href="javascript:;" class="btn white btn-sm search-reset"><i class="fa fa-eraser"></i> 清除 </a>
		</div>
	</div>
	<div class="portlet-body form">
	   	<form action="/placeAD/list" class="form-horizontal" method="get" id="searchForm">
			<div class="form-body">
				<div class="row">
					<div class="col-md-3">
						<label class="col-md-4 control-label">位置：</label>
						<div class="col-md-8">
					    	<select class="form-control" name="location" id="location" required >
                           		<option > </option>
                           		<option value="index.banner.ad.1">banner1(1920*360)</option>
	                       		<option value="index.banner.ad.2">banner2(1920*360)</option>
	                       		<option value="index.banner.ad.3">banner3(1920*360)</option>
	                       		<option value="index.banner.ad.4">banner4(1920*360)</option>
	                       		<option value="index.banner.ad.5">banner5(1920*360)</option>
	                       		<option value="index.header.ad.1">页头广告1(100*100)</option>
	                       		<option value="index.header.ad.2">页头广告2(100*100)</option>
	                       		<option value="index.header.ad.3">页头广告3(100*100)</option>
	                       		<option value="index.header.ad.4">页头广告4(100*100)</option>
	                       		<option value="index.side.ad.1">侧边广告1(390*350)</option>
	                       		<option value="index.side.ad.2">侧边广告2(390*350)</option>
	                       		<option value="index.side.ad.3">侧边广告3(390*350)</option>
	                       		<option value="index.side.ad.4">侧边广告4(390*350)</option>
	                       		<option value="index.side.ad.5">侧边广告5(390*350)</option>
	                       		<option value="index.side.ad.6">侧边广告6(390*350)</option>
		                       	<option value="index.wx.ad.1">微信广告1(282*380)</option>
	                       		<option value="index.wx.ad.2">微信广告2(210*190)</option>
	                       		<option value="index.wx.ad.3">微信广告3(210*190)</option>
	                       		<option value="index.wx.ad.4">微信广告4(420*190)</option>
                            </select>
                            <script type="text/javascript">
							jQuery("#location").find("option[value='$!location']").attr("selected",true);
							</script>
						</div>
					</div>
	    		</div>
			</div>
		</form>
	</div>
</div>

<div class="portlet box green">
	<div class="portlet-title">
		<div class="caption"><i class="fa fa-cogs"></i>数据列表</div>
		<div class="tools"><a href="javascript:;" class="collapse" data-original-title="" title=""> </a></div>
		<div class="actions">
			<a href="#modelContent" thref="/placeAD/add" class="btn white btn-sm ajax-model-get" code="placeAD.add" data-toggle="modal">
				<i class="fa fa-plus"></i> 新增 
			</a>
		</div>
	</div>
	<div class="portlet-body">
        <div class="dataTables_wrapper no-footer">
        	<div class="table-scrollable">
		        <table class="table table-striped table-bordered table-hover">
		            <thead>
		                <tr>
		                    <th> 图片 </th>
		                    <th> 位置 </th>
		                    <th> URL </th>
		                    <!-- <th> 排序 </th> -->
		                    <th> 排序 </th>
		                    <th>状态</th>
		                    <th class="col-md-3"> 操作 </th>
		                </tr>
		            </thead>
		            <tbody>
		                 #foreach ($!item in $!pagePlaceAD.result)
		                 <tr class="odd gradeX">
		                     <td>
								<a class="ajax-model-get" data-toggle="modal" href="#modelContent" thref="/placeAD/edit?id=$!item.id&$!queryString">
									<img alt="" title="" src="$!item.image" style="width: 60px;height: 60px">
								</a>
							</td>
		                     <td>
								  #if($!item.location=='index.banner.ad.1')
				                     banner1
			                     #elseif($!item.location=='index.banner.ad.2')
				                     banner2
			                     #elseif($!item.location=='index.banner.ad.3')
				                     banner3
			                     #elseif($!item.location=='index.banner.ad.4')
				                     banner4
			                     #elseif($!item.location=='index.banner.ad.5')
				                     banner5
			                     #elseif($!item.location=='index.header.ad.1')
			                       	页头广告1
			                     #elseif($!item.location=='index.header.ad.2')
                                   	 页头广告2
			                     #elseif($!item.location=='index.header.ad.3')
                                   	  页头广告3
			                     #elseif($!item.location=='index.header.ad.4')
                                   	  页头广告4
			                     #elseif($!item.location=='index.side.ad.1')
                                  	  侧边广告1
			                     #elseif($!item.location=='index.side.ad.2')
                                  	  侧边广告2
			                     #elseif($!item.location=='index.side.ad.3')
                                   	  侧边广告3
			                     #elseif($!item.location=='index.side.ad.4')
                                	  侧边广告4
			                     #elseif($!item.location=='index.side.ad.5')
                                  	  侧边广告5
			                     #elseif($!item.location=='index.side.ad.6')
                                  	  侧边广告6
                                 #elseif($!item.location=='index.wx.ad.1')	  
		                           	 微信广告1
		                         #elseif($!item.location=='index.wx.ad.2')
		                      		 微信广告2
		                      	#elseif($!item.location=='index.wx.ad.3')
		                      		 微信广告3
		                      	#elseif($!item.location=='index.wx.ad.4')
		                      		 微信广告4
			                     #end   
		                     </td>
		                     <td>$!item.url</td>
		                     <td> $!item.sort </td>
		                     <td id="$!item.id">#if($!item.status) 启用 #else 禁用 #end</td>
		                     <td>
		                     	<a href="javascript:;" class="hidden" code="placeAD.publish" style="text-decoration: none">
		                    		<input #if($!item.status) checked #end type='checkbox' data-size='small' class='make-switch' 
		                    			sendid="$!{item.id}" data-on-color='success' data-off-color='warning'>
		                    	</a>
		                        <a class="btn green btn-outline btn-sm ajax-model-get" code="placeAD.edit" data-toggle="modal" href="#modelContent"  thref="/placeAD/edit?id=$!item.id&$!queryString">
									<i class="fa fa-edit"></i>
									修改
								</a>
								<a class="btn green btn-outline btn-sm ajax-delete" code="placeAD.delete" href="javascript:;" thref="/placeAD/delete?id=$!item.id">
									<i class="fa fa-trash"></i>
									删除
								</a>
		                     </td>
		                 </tr>
		                 #end
		            </tbody>
		        </table>
			</div>
			#set($page=$pagePlaceAD)
			#set($pageUrl="/placeAD/list.do?$!queryString&pageNo=")
			#parse("_page.htm")
		</div>
	</div>
</div> 
<script type="text/javascript" src="/assets/scripts/views-permission.js"></script>
<script type="text/javascript">
$('.stockAttr').each(function(i,v){
	var stockAttr=$(v).text();
	$(v).text(jQuery("#location").find("option[value='"+stockAttr+"']").text());
});
bootstrapSwitch.init({url:"placeAD/modifiedStatus",ontext:"启用",offtext:"禁用"});
ComponentsSelect2.init();
</script>
